<!--
 * @Description:
 * @Version: 0.1
 * @Author: EveChee
 * @Date: 2020-05-27 11:24:43
 * @LastEditTime: 2020-07-10 14:38:09
-->
<template>
    <SubMenu :item="item" v-if="showSub"></SubMenu>
    <MenuItem :item="item" v-else></MenuItem>
</template>

<script lang="ts">
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import SubMenu from './SubMenu.vue'
@Component({
    components: { SubMenu },
})
export default class SideBarItem extends Vue {
    @Prop()
    item: any
    get hasChildren(){
        return this.item.children && this.item.children.length
    }
    get showSub(){
        return this.hasChildren || this.item.lazy
    }
}
</script>

<style scoped lang="scss"></style>
